
const mysql = require('mysql2');

const con = mysql.createPool({
  port: 3306,
  host: '47.101.45.245',
  database: 'webchart',
  user: 'webchart',
  password: 'Ks5Kcy7stRzx24N5'
})


const exec = (sql, params) => {
  return new Promise((resolve, reject) => {
    con.query(sql, params, (err, data) => {
      if (err) reject(err)
      resolve(data)
    })
  })
}

module.exports = {
  exec
}
